cmake_minimum_required(VERSION 3.10)

project(ZM32_GW C)
set(CMAKE_C_STANDARD 11)

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -g -ggdb -Wall")

include_directories(${PROJECT_SOURCE_DIR}/lib)
include_directories(${PROJECT_SOURCE_DIR}/common)
include_directories(${PROJECT_SOURCE_DIR}/db_access)
#include_directories(${PROJECT_SOURCE_DIR}/unidev)

aux_source_directory(${PROJECT_SOURCE_DIR}/lib LIB_SRCS)
aux_source_directory(${PROJECT_SOURCE_DIR}/common COMMON_SRCS)
aux_source_directory(${PROJECT_SOURCE_DIR}/db_access DB_SRCS)
#aux_source_directory(${PROJECT_SOURCE_DIR}/unidev UNIDEV_SRCS)

add_library(zm32 SHARED
            ${LIB_SRCS}
            ${COMMON_SRCS})


add_executable(main
               ${PROJECT_SOURCE_DIR}/main.c
               ${LIB_SRCS}
               ${COMMON_SRCS}
               ${DB_SRCS}
               )

target_link_libraries(main -lpthread -lsqlite3 -ldl -lssl -lcrypto)